package code;

public class SwitchCell extends ContainerCell
{
	private GoalCell goal;
	
	public SwitchCell(String texture, GoalCell goal)
	{
		super(texture);
		this.goal = goal;
	}
	
	@Override
	public void placeObject(MovableObject obj)
	{
		super.placeObject(obj);
		
		if (obj.activatesSwitch())
			goal.setVisible(true);	
	}
	
	@Override
	public MovableObject takeObject()
	{
		MovableObject aux = super.takeObject();
		
		goal.setVisible(false);
		
		return aux;
	}

}
